<template>
  <el-select placeholder="请选择" v-model="form.channel_id">
    <el-option
      v-for="item in $store.state.channelList"
      :key="item.id"
      :label="item.name"
      :value="item.id"
    ></el-option>
  </el-select>
</template>
<script>
import { channel } from '@/api/index.js'
export default {
  name: '',
  props: ['form'],
  data () {
    return {}
  },
  async created () {
    // 获取频道
    if (this.$store.state.channelList.length === 0) {
      const res = await channel()
      console.log('频道求')
      this.$store.commit('channelListGet', res.data.channels)
    }
  }
}
</script>
<style scoped lang="less"></style>
